# Contributor: Newbyte <newbie13xd@gmail.com>
# Maintainer: Newbyte <newbie13xd@gmail.com>
pkgname=karlender
pkgver=0.6.0
pkgrel=0
pkgdesc="Mobile friendly GTK based calendar app written in Rust"
url="https://gitlab.com/loers/karlender"
# ppc64le: build script for dependency ring 0.16.20 fails
# s390x, riscv64: blocked by rust/cargo
arch="all !ppc64le !riscv64 !s390x"
license="GPL-3.0-or-later"
makedepends="
	cargo
	cargo-gra
	libadwaita-dev
	"
source="https://gitlab.com/loers/karlender/-/archive/v$pkgver/karlender-v$pkgver.tar.gz
	"
options="!check"
builddir="$srcdir/$pkgname-v$pkgver"

export CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1
export CARGO_PROFILE_RELEASE_LTO="true"
export CARGO_PROFILE_RELEASE_OPT_LEVEL="s"
export CARGO_PROFILE_RELEASE_PANIC="abort"

prepare() {
	default_prepare

	cargo fetch --locked
}

build() {
	cargo gra gen
	cargo build --release --frozen
}

package() {
	cargo install --locked --root "$pkgdir/usr" --path .
	make -C target/gra-gen install ROOT="$pkgdir/usr"

	rm "$pkgdir"/usr/.crates.toml
	rm "$pkgdir"/usr/.crates2.json
}

sha512sums="
283e8b2d4f64e548c7c52f8f9dc67e372b86ad9d59176b3dce9d960453e528b36b172029e7fa1cad69f8fbd332e6be43b31932b6e0092e5fc6d23125aa6cb20d  karlender-v0.6.0.tar.gz
"
